import React, { lazy } from "react";
import { WapHomeO, CartO, CouponO, UserO } from "@react-vant/icons";
const Home = lazy(() => import("../views/home"));
const Classify = lazy(() => import("../views/classify"));
const Car = lazy(() => import("../views/car"));
const User = lazy(() => import("../views/user"));

const Detail = lazy(() => import("../views/detail"));
const Login = lazy(() => import("../views/login"));
const MainLayout = lazy(() => import("../views/mainLayout"));
const Search = lazy(() => import("../views/search"));
const Order = lazy(() => import("../views/order"));

export const MainLayoutChildren = [
  {
    path: "/",
    element: <Home></Home>,
    meta: {
      title: "首页",
      icon: <WapHomeO />,
    },
  },
  {
    path: "/classify",
    element: <Classify></Classify>,
    meta: {
      title: "分类",
      icon: <CouponO />,
    },
  },
  {
    path: "/car",
    element: <Car></Car>,
    meta: {
      title: "购物车",
      icon: <CartO />,
    },
  },
  {
    path: "/user",
    element: <User></User>,
    meta: {
      title: "用户",
      icon: <UserO />,
    },
  },
];

export const ROUTE_LIST = [
  {
    path: "/detail/:id",
    element: <Detail></Detail>,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },

  {
    path: "/search",
    element: <Search></Search>,
  },
  {
    path: "/order",
    element: <Order></Order>,
  },
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: MainLayoutChildren,
  },
];
